package uk.org.landeg.euler.problems.unported;


public class PythagTriplet {
	private int a, b, c;
	
	public static PythagTriplet getInstance (int m, int n) {
		PythagTriplet trip = new PythagTriplet();
		trip.setA(m*m-n*n);
		trip.setB(2*m*n);
		trip.setC(m*m + n*n);
		return trip;
	}

	public int getA() {
		return a;
	}

	public void setA(int a) {
		this.a = a;
	}

	public int getB() {
		return b;
	}

	public void setB(int b) {
		this.b = b;
	}

	public int getC() {
		return c;
	}

	public void setC(int c) {
		this.c = c;
	}
	
	public int getPerimiter () {
		return a + b + c;
	}
	
	public String toString () {
		return new String ("{" + a + "," + b + "," + c + "}");
	}
}
